import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Rectangle;


public class Food {
	private int x;
	private int y;
	private int size;
	private int borderSize;
	private Environment e;
	public Food(int x,int y,Environment e, int gridSize){
		this.x = x;
		this.y = y;
		this.size=(e.getWidth()-110)/gridSize;
		this.borderSize=50;
		this.e=e;
	}
	
	public Graphics2D paint(Graphics2D gimage){
		size=(e.getWidth()-110)/e.getSnake().getGridSize();
		gimage.setColor(new Color(20,170,20));
		gimage.fill(new Rectangle(borderSize+x*size+1,borderSize+y*size+1,size-2,size-2));
		return gimage;
	}
	
	public int getX() {
		return x;
	}

	public int getY() {
		return y;
	}

}
